package com.woniuxy.common.mapper;

import com.woniuxy.common.entity.MarketCollect;
import com.woniuxy.common.entity.MarketCollectExample;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface MarketCollectMapper {
    long countByExample(MarketCollectExample example);

    int deleteByExample(MarketCollectExample example);

    int deleteByPrimaryKey(String id);

    int insert(MarketCollect record);

    int insertSelective(MarketCollect record);

    List<MarketCollect> selectByExample(MarketCollectExample example);

    MarketCollect selectByPrimaryKey(String id);

    int updateByExampleSelective(@Param("record") MarketCollect record, @Param("example") MarketCollectExample example);

    int updateByExample(@Param("record") MarketCollect record, @Param("example") MarketCollectExample example);

    int updateByPrimaryKeySelective(MarketCollect record);

    int updateByPrimaryKey(MarketCollect record);

    @Select("select * from market_collect where user_id=#{userid} order By date DESC")
    List<MarketCollect> selectMyCollectByUserId(String userid);

    @Select("select * from market_collect where user_id=#{loginuserid} and commodity_id=#{commodityid}")
    MarketCollect selectCollectStatus(@Param("commodityid") String commodityid, @Param("loginuserid") String loginuserid);
}